//
//  MLAShopFoodCommitOrderView.m
//  MagicLampApp
//
//  Created by Zheng on 2019/4/8.
//  Copyright © 2019 zheng.magic.lamp.app. All rights reserved.
//

#import "MLAShopFoodCommitOrderView.h"

@implementation MLAShopFoodCommitOrderView

- (instancetype)init {
    self = [super init];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        
        UIView *lineView = [[UIView alloc] init];
        lineView.backgroundColor = CX_GetColorHex(0xEBEBEB, 1);
        [self addSubview:lineView];
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.offset(0);
            make.height.offset(1);
        }];
        
        _buyBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _buyBtn.backgroundColor = CX_GetColorHex(0x0094F2, 1);
        _buyBtn.titleLabel.font = CX_GetNormalFont(14);
        _buyBtn.layer.cornerRadius = 5;
        _buyBtn.layer.masksToBounds = YES;
        [_buyBtn setTitle:@"去结算" forState:UIControlStateNormal];
        [self addSubview:_buyBtn];
        [_buyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.offset(100);
            make.height.offset(40);
            make.right.offset(-15);
            make.bottom.offset(-10);
        }];
        
        
        _titleLbl = [[UILabel alloc] init];
        _titleLbl.font = CX_GetNormalFont(16);
        _titleLbl.text = @"合计：";
        [self addSubview:_titleLbl];
        [_titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.offset(15);
            make.centerY.offset(0);
            make.width.offset(50);
        }];
        
        _priceLbl = [[UILabel alloc] init];
        _priceLbl.textColor = CX_GetColorRed();
        _priceLbl.font = CX_GetNormalFont(14);
        _priceLbl.text = @"0.00";
        [self addSubview:_priceLbl];
        [_priceLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.titleLbl.mas_right);
            make.centerY.offset(0);
            make.right.equalTo(self.buyBtn.mas_left).offset(-15);
        }];
        
    }
    return self;
}

@end
